import Vue from 'vue'
import App from './App.vue'
//三级联动组件--全局组件
import TypeNav from '@/pages/Home/TypeNav';
import Pagination from '@/components/Pagination/Pagination.vue'

import router from './router'
import { reqCategoryList } from '@/api'
import store from "@/store"
//引入mock数据
import "@/mock/mockServe"
//引入swiper样式
import "swiper/css/swiper.css"
//引入iconfont
import '@/assets/font_3505764_q9ginw77zj/iconfont.css'
//引入全部的接口
import * as API from '@/api'
//按需引入element-UI
import { Button, MessageBox } from 'element-ui'
//引入插件（图片懒加载）
import VueLazyload from 'vue-lazyload'
//引入懒加载的图片
import loadimage from '@/assets/images/111.jpg'
//引入表单校验插件
import "@/plugins/validate"

//注册图片懒加载插件
Vue.use(VueLazyload, {
  loading: loadimage,
})

reqCategoryList();

Vue.component(TypeNav.name, TypeNav)
Vue.component(Pagination.name, Pagination)

Vue.config.productionTip = false
//注册element-UI中Button为全局组件
Vue.component(Button.name, Button)
//把弹出层绑在原型上
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;



new Vue({
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API

  },
  router,
  store
}).$mount('#app')
